package com.yunhe.sms.dao.activite.impl;

import com.yunhe.commens.dao.impl.BaseDaoImpl;
import com.yunhe.sms.dao.activite.VoteLogDao;
import com.yunhe.sms.entity.activity.VoteLog;

import java.util.Date;

/**
 * @author LeiPeifeng
 * @version V1.0
 * @date 2017/11/2 0002 19:35
 * @Description: ${todo}(用一句话描述该文件做什么)
 */
public class VoteLogDaoImpl extends BaseDaoImpl<VoteLog> implements VoteLogDao{

    @Override
    public void add(VoteLog voteLog) {
        String sql=" insert into vote_log(ip,vote_id,mac,date) values(?,?,?,? )";
        super.cut ( sql,voteLog.getIp (),voteLog.getVoteId (),voteLog.getMac (),voteLog.getDate () );
    }

    @Override
    public void deleted(Long id) {
        String sql= " deleted * from vote_log where id=? ";
        super.cut ( sql );
    }

    @Override
    public VoteLog find(Long voteID, String mac, String date) {
        String sql=" select ip,vote_id voteId,mac,date from vote_log where vote_id=? and mac=? and date=? ";
        return super.quaryOne ( sql,voteID,mac,date );
    }
}
